<script setup lang="ts">
import { ref } from "vue";
import CounterComp from "@/components/CounterComp.vue";
import MyComp from "./components/MyComp.vue";

const myComp = ref<InstanceType<typeof MyComp> | null>(null);

const openModal = () => { 
  myComp.value?.toggleShown();
}

const count = ref<number>(0);
const title = ref("计算器");

// const change = (v: number) => { 
//   count.value = v;
// }
</script>

<template>
  <div>
    <button @click="openModal">点击显示/隐藏 MyComp</button>
    <MyComp ref="myComp"/>
    <!-- <CounterComp :count="count" :title="title" @change="change"/> -->
    <CounterComp v-model:count="count" v-model:title="title"/>
  </div>
  
</template>
